﻿@using Sausage.Web.Domain
@using Sausage.Web.DataModel
@using Sausage.Web.Models
@model Sausage.Web.Models.ProjectPlanListRow
@{
    ViewBag.Title = string.Format("查看工程计划（{0}） 版本：{1:00}", Model.ProjectName, Model.Version);
    Layout = "~/Views/Shared/MainLayout.cshtml";
}
<h2>@ViewBag.Title</h2>
<br />
<div class="form-box">
    <table class="TableDetail">
        <tr>
            <th>
                所属单位
            </th>
            <td>
                @Html.DisplayFor(model => model.Organization)
            </td>
        </tr>
        <tr>
            <th>
                项目名称
            </th>
            <td>
                @Html.ActionLink(Model.ProjectName, "ViewProject", "Project", new { projectID = @Model.ProjectID }, new { @target = "_blank" })
            </td>
        </tr>
        <tr>
            <th>
                项目编号
            </th>
            <td>
                @Html.ActionLink(Model.ProjectCode, "ViewProject", "Project", new { projectID = @Model.ProjectID }, new { @target = "_blank" })
            </td>
        </tr>
        <tr>
            <th>
                计划版本
            </th>
            <td>
                @Html.Raw(string.Format("{0:00}", Model.Version))
            </td>
        </tr>
        <tr>
            <th>
                工程计划
            </th>
            <td style="padding: 0; margin: 0;">
                <table class="TableDetailList">
                    <tr>
                        <th class="FirstCell">
                            分项工程
                        </th>
                        <th>
                            工程量
                        </th>
                        <th>
                            单位
                        </th>
                        <th>
                            单价
                        </th>
                        <th class="LastCell">
                            小计
                        </th>
                    </tr>
                    @foreach (ProjectPlanItemListRow item in Model.Items)
                    {
                        @Html.Raw("<tr>")
                        @Html.Raw(string.Format("<td class=\"FirstCell\">{0}</td>", item.Construction))
                        @Html.Raw(string.Format("<td class=\"Money\">{0:#,##0.000}</td>", item.Quantity))
                        @Html.Raw(string.Format("<td>{0}</td>", item.Unit))
                        @Html.Raw(string.Format("<td class=\"Money\">{0:#,##0.000}</td>", item.Price))
                        @Html.Raw(string.Format("<td class=\"Money LastCell\">{0:#,##0.000}</td>", item.Amount))
                        @Html.Raw("</tr>")
                    }
                    <tr>
                        <td class="FirstCell" style="border-bottom-width: 0px;">
                            合计
                        </td>
                        @Html.Raw(string.Format("<td colspan=\"4\" class=\"Money LastCell\">{0:#,##0.000}</td>", Model.Items.Sum(item => item.Amount)))
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <th>
                填报人
            </th>
            <td>
                @Html.DisplayFor(model => model.Applicant)
            </td>
        </tr>
        <tr>
            <th>
                填报日期
            </th>
            <td>
                @string.Format("{0:yyyy年MM月dd日}", Model.ApplicationDate)
            </td>
        </tr>
        <tr>
            <th>
                审核人
            </th>
            <td>
                @Html.DisplayFor(model => model.Auditor)
            </td>
        </tr>
        <tr>
            <th>
                审核日期
            </th>
            <td>
                @string.Format("{0:yyyy年MM月dd日}", Model.AuditedDate)
            </td>
        </tr>
        <tr>
            <th>
                批准人
            </th>
            <td>
                @Html.DisplayFor(model => model.Approver)
            </td>
        </tr>
        <tr>
            <th>
                批准日期
            </th>
            <td>
                @string.Format("{0:yyyy年MM月dd日}", Model.ApprovedDate)
            </td>
        </tr>
        <tr>
            <th>
                备注
            </th>
            <td>
                @Html.DisplayFor(model => model.Memo)
            </td>
        </tr>
    </table>
</div>
<br />
